<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <input type="number" v-model.number="price">
        <input type="number" v-model.number="count">
        {{sum}}
    </div>
    <script>
        new Vue({
            el:"#app",
            data:{
                price:3,
                count:10
            },
            // 当data中参与计算的值发生改变的时候，会触发
            computed:{
                sum(){
                    return this.price*this.count
                }
            }
        })
    </script>
</body>
</html>